package com.houtai.common.util;


import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;


public class MD5 {

	/**
	 * @Purpose  MD5加密
	 * @version  1.0
	 * @author   lizhun
	 * @param    str
	 * @return   String
	 */
	public static String code(String str) {
		try {
			MessageDigest digest = MessageDigest.getInstance("md5");
			byte[] data = digest.digest(str.getBytes());
			StringBuilder sb = new StringBuilder();
			for (int i = 0; i < data.length; i++) {
				String result = Integer.toHexString(data[i] & 0xff);
				if (result.length() == 1) {
					result = "0" + result;
				}
				sb.append(result);
			}
			return sb.toString();
		} catch (NoSuchAlgorithmException e) {
		}
		return null;
	}

	public static void main(String[] args) {
		String x = "182180831160674";
		Long y = Long.parseLong(x) + 1;
		System.out.println(y);
//		 String start_order_day = "12345678";
//		System.out.println(start_order_day.substring(0, 4) + "-" + start_order_day.substring(4, 6) + "-" + start_order_day.substring(6, 8));
//		System.out.println(CommonUtil.datePlus(-1));
//		System.out.println(code("baoxiang123456"));
//		System.out.println(code("15856421564id"));
//		System.out.println(code("15856421564key"));
	}
}
